@extends('web.common.main')
@section('headmeta')
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="format-detection" content="telephone=no">
@endsection
@section('css')
    <link rel="stylesheet" href="{{env('SOURCE_PATH')}}css/act1.css">
@endsection
@section('container')

<div class="act1_head act1_head_fb">
    <h1>渔船技改征集
        <small>关于渔船节能技改项目的技术/设备征集</small>
    </h1>
</div>
<div class="act1_con">
    <div class="act1_body">
        <div class="act1_section">
            <div class="title">项目简介</div>
            <div class="content">
                <p>浙江碳银与中国渔协就渔船节能改造签订了合作协议，从中韩、中日边境海域作业的1921艘渔船入手进行节能改造（中国渔协履行跨境作业渔船捕捞证的审批职能），并按照“先试点，后推广”的模式，在全国范围内进行优秀渔船节能技术的推广运用。中韩、中日跨境渔船的分布、种类等情况如下：</p>
                <div class="act1_table">
                    <table>
                        <caption>中韩边境作业渔船</caption>
                        <thead>
                        <tr>
                            <th>渔船种类</th>
                            <th>渔船数目</th>
                            <th>吨位(t)</th>
                            <th>主机功率(KW)</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>拖网</td>
                            <td>双拖770艘<br>单拖14艘</td>
                            <td>300以下</td>
                            <td>558-1357</td>
                        </tr>
                        <tr>
                            <td>围网</td>
                            <td>网船21艘<br>灯船43艘<br>运输船24艘</td>
                            <td>278以下</td>
                            <td>520-600</td>
                        </tr>
                        <tr>
                            <td>鱿鱼钓</td>
                            <td>55艘</td>
                            <td>280以下</td>
                            <td>43-620</td>
                        </tr>
                        <tr>
                            <td>刺网</td>
                            <td>673艘</td>
                            <td>100以下</td>
                            <td>135-980</td>
                        </tr>
                        </tbody>
                    </table>
                    <table>
                        <caption>中日边境作业渔船</caption>
                        <thead>
                        <tr>
                            <th>渔船种类</th>
                            <th>渔船数目</th>
                            <th>吨位（t）</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>底拖网</td>
                            <td>263艘</td>
                            <td>324以下</td>
                        </tr>
                        <tr>
                            <td>鱿鱼钓</td>
                            <td>生产船55艘<br>辅助船3艘</td>
                            <td>280以下</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <p>本次渔船节能技术/设备征集主要分为节油/节电、冷藏、安全、其他技术/设备四个种类，要求征集的技术/产品性价比高、实用性强，且具有一定应用的案例。</p>
            </div>
        </div>
        <div class="act1_section">
            <div class="title">技改意义</div>
            <div class="content">
                <p>能耗高是长期困扰中国远洋渔船发展的问题之一。据报道，中国渔船燃油消耗占捕捞生产成本最高达到70%以上。渔船老化、节能型渔具材料的研发应用不够、新型探捕和集鱼灯等附属装备推广不足己成为我国远洋渔船高能耗、低效率的重要原因。</p>
                <p>财政部《关于调整国内渔业捕捞和养殖业油价补贴政策促进渔业持续健康发展的通知》：到2019年，将国内捕捞业油价补贴降至2014年补贴水平的40%。油价补贴的削减等于减少了渔民一部分生产补助资金，为节省开支，渔民的节油意愿进一步加强。</p>
            </div>
        </div>
        <div class="act1_section">
            <div class="title">市场空间</div>
            <div class="content">
                <p>据对全国1万户渔民家庭当年收支情况抽样调查，全国渔民人均纯收入15594. 83元，比上年增加1168.57元、增长8.10%，低于“十二五”期间全国农民人均纯收入9.2%的增长速度 ，通过渔船的节能技改“变相”增加渔民收入成为渔民增收的重要途径之一。</p>
                <p>2015年末登记在册渔船总数104. 25万艘、总吨位1086. 33万吨。其中，机动渔船67. 24万艘、总吨位1040. 64万吨、总功率2256.99万千瓦；非机动渔船37. 01万艘、总吨位为45. 68万吨。机动渔船数目庞大，节能技术有着广泛的推广空间。</p>
                <p>以浙江省为例，根据《浙江省海洋与渔业局关于实施标准化海洋捕捞渔船更新改造通知》确定2015-2019年更新建造标准化海洋捕捞渔船不少于1806艘，从政府角度讲，希望通过技改等方式提升装备水平，增强渔业整体的综合实力。</p>
            </div>
        </div>
        <div class="act1_section">
            <div class="title">联系方式</div>
            <div class="content">
                <ul class="contact">
                    <li>联系人：田经理</li>
                    <li>联系电话：0571 8292 9382</li>
                    <li>联系邮箱：tianbl@tanwin.cn</li>
                </ul>
            </div>
        </div>
        <div class="act1_section act1-media_fixed">
            <div class="title">网上报名</div>
            <div class="content">
                <a href="#boater" class="btn btn-reverse">我要报名</a>
            </div>
        </div>
    </div>
    <div class="act1_body" style="display: none">
        <div class="act1_section">
            <div class="act1_form">
                <div class="title"><span>渔船节能技改项目技术/设备报名表</span></div>
                <div class="form-group">
                    <label class="require" for="company_name">企业名称</label>
                    <input type="text" class="form-control" id="company_name" maxlength="100">
                </div>
                <div class="form-group">
                    <label class="require" for="user_name">联系人</label>
                    <input type="text" class="form-control form-control_sm" id="user_name" maxlength="20">
                </div>
                <div class="form-group">
                    <label class="require" for="user_phone">联系手机</label>
                    <input type="text" class="form-control form-control_sm" id="user_phone" maxlength="11">
                </div>
                <div class="form-group">
                    <label class="require" for="company_desc">企业概况</label>
                    <textarea class="form-control" id="company_desc" maxlength="500" rows="6"></textarea>
                </div>
                <div class="form-group">
                    <label class="require" for="tech_device_case">供应项</label>
                    <div class="act1_tech">
                        <ul class="j_techItem"></ul>
                        <a class="btn btn-warning j_newItem">新增供应项</a>
                        <input type="hidden" id="tech_id" value="">
                        <div class="media-bg j_popBg" style="display: none"></div>
                        <div class="table j_itemTable" style="display: none">
                            <div class="form-group">
                                <label for="tech_device_type">技术/设备分类</label>
                                <select class="form-control form-control_sm" id="tech_device_type">
                                    @forelse(@$list as $key=>$value)
                                        <option value="{{$key}}">{{$value}}</option>
                                    @empty

                                    @endforelse
                                </select>
                                <label class="require" for="tech_device_name">名称</label>
                                <input type="text" class="form-control form-control_sm" id="tech_device_name"
                                       maxlength="60">
                            </div>
                            <div class="form-group">
                                <label for="tech_device_brand">品牌</label>
                                <input type="text" class="form-control form-control_sm" id="tech_device_brand"
                                       maxlength="60">
                                <label>是否有专利</label>
                                <label class="radio" for="tech_device_bool_patent1">
                                    <input id="tech_device_bool_patent1" name="tech_device_bool_patent" value="1"
                                           type="radio" checked> 是
                                </label>
                                <label class="radio" for="tech_device_bool_patent0">
                                    <input id="tech_device_bool_patent0" name="tech_device_bool_patent" value="0"
                                           type="radio"> 否
                                </label>
                            </div>
                            <div class="form-group">
                                <label for="tech_device_fix_years">维保期限</label>
                                <input type="text" class="form-control form-control_sm" id="tech_device_fix_years"
                                       maxlength="20">
                            </div>
                            <div class="form-group">
                                <label for="tech_content">技术内容</label>
                                <textarea class="form-control" id="tech_content" maxlength="500"
                                          rows="3"></textarea>
                            </div>
                            <div class="form-group">
                                <label for="tech_main_point">主要指标</label>
                                <textarea class="form-control" id="tech_main_point" maxlength="500"
                                          rows="3"></textarea>
                            </div>
                            <div class="form-group">
                                <label for="tech_advantage">技术优势</label>
                                <textarea class="form-control" id="tech_advantage" maxlength="500"
                                          rows="3"></textarea>
                            </div>
                            <div class="form-group">
                                <label for="tech_used_range">适用范围</label>
                                <textarea class="form-control" id="tech_used_range" maxlength="500"
                                          rows="3"></textarea>
                            </div>
                            <div class="form-group">
                                <label for="tech_device_case">典型案例</label>
                                <textarea class="form-control" id="tech_device_case" maxlength="500"
                                          rows="3"></textarea>
                            </div>
                            <div class="form-group">
                                <label for="tech_vista">推广前景及减排潜力</label>
                                <textarea class="form-control" id="tech_vista" maxlength="500"
                                          rows="3"></textarea>
                            </div>
                            <div class="form-group">
                                <div class="text-center">
                                    <a class="btn btn-reverse j_submitItem">确定</a>
                                    <a class="btn j_cancelItem">取消</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="content">
                <a class="btn btn-reverse j_submitSupplier">提交报名信息</a>
                <a class="btn j_backUrl">返回</a>
            </div>
        </div>
    </div>
</div>


@endsection


@section('script')
<script>
    (function ($) {
        $(function () {
            //新增供应项
            $('.j_newItem').on('click', function () {
                resetItemForm();
                $('.j_itemTable,.j_popBg').css('display', 'block');
            });
            $('.j_techItem').on('click', '.j_editItem', function () {
                //編輯供应项
                var $p = $(this).parents('li');
                $('#tech_id').val($('.j_techItem li').index($p));
                $('#tech_device_type').val($p.find('.j_tech_device_type').val());
                $('#tech_device_name').val($p.find('.j_tech_device_name').val());
                $('#tech_device_brand').val($p.find('.j_tech_device_brand').val());
                if ($p.find('.j_tech_device_bool_patent').val() == 1) {
                    $('#tech_device_bool_patent1').prop('checked', true);
                } else {
                    $('#tech_device_bool_patent0').prop('checked', true);
                }
                $('#tech_device_fix_years').val($p.find('.j_tech_device_fix_years').val());
                $('#tech_content').val($p.find('.j_tech_content').val());
                $('#tech_main_point').val($p.find('.j_tech_main_point').val());
                $('#tech_advantage').val($p.find('.j_tech_advantage').val());
                $('#tech_used_range').val($p.find('.j_tech_used_range').val());
                $('#tech_device_case').val($p.find('.j_tech_device_case').val());
                $('#tech_vista').val($p.find('.j_tech_vista').val());
                $('.j_itemTable,.j_popBg').css('display', 'block');
            }).on('click', '.j_delItem', function () {
                //刪除供应项
                //如果刪除项是当前编辑项，删除会改变li的index值，将影响编辑项的保存位置，暂不做处理
                //if($('.j_techItem li').index($(this).parents('li')) == $('#tech_id').val()){
                resetItemForm();
                $('.j_itemTable,.j_popBg').css('display', 'none');
                //}
                $(this).parents('li').remove();
            });
            //重置供应项表单
            function resetItemForm() {
                $('#tech_id').val('');
                $('#tech_device_type').val('');
                $('#tech_device_name').val('');
                $('#tech_device_brand').val('');
                $('#tech_device_bool_patent1').prop('checked', true);
                $('#tech_device_fix_years').val('');
                $('#tech_content').val('');
                $('#tech_main_point').val('');
                $('#tech_advantage').val('');
                $('#tech_used_range').val('');
                $('#tech_device_case').val('');
                $('#tech_vista').val('');
            }
            //保存供应项
            $('.j_submitItem').on('click', function () {
                var $btn = $(this);
                var maxlen = 0;
                var $tech_device_type = $("#tech_device_type");
                var tech_device_type = $tech_device_type.val();
                var tech_device_type_text = $tech_device_type.find('option:selected').text();

                var $tech_device_name = $("#tech_device_name");
                maxlen = $tech_device_name.attr('maxlength');
                var tech_device_name = $tech_device_name.val();
                if (!tech_device_name || tech_device_name.length > maxlen) {
                    return showErr($tech_device_name, "请输入名称，" + maxlen + "字以内");
                }
                var $tech_device_brand = $("#tech_device_brand");
                maxlen = $tech_device_brand.attr('maxlength');
                var tech_device_brand = $tech_device_brand.val();
                if (tech_device_brand.length > maxlen) {
                    return showErr($tech_device_brand, maxlen + "字以内");
                }
                var tech_device_bool_patent = $('[name="tech_device_bool_patent"]:checked').val();

                var $tech_device_fix_years = $("#tech_device_fix_years");
                maxlen = $tech_device_fix_years.attr('maxlength');
                var tech_device_fix_years = $tech_device_fix_years.val();
                if (tech_device_fix_years.length > maxlen) {
                    return showErr($tech_device_fix_years, maxlen + "字以内");
                }
                var $tech_content = $("#tech_content");
                maxlen = $tech_content.attr('maxlength');
                var tech_content = $tech_content.val();
                if (tech_content.length > maxlen) {
                    return showErr($tech_content, maxlen + "字以内");
                }
                var $tech_main_point = $("#tech_main_point");
                maxlen = $tech_main_point.attr('maxlength');
                var tech_main_point = $tech_main_point.val();
                if (tech_main_point.length > maxlen) {
                    return showErr($tech_main_point, maxlen + "字以内");
                }
                var $tech_advantage = $("#tech_advantage");
                maxlen = $tech_advantage.attr('maxlength');
                var tech_advantage = $tech_advantage.val();
                if (tech_advantage.length > maxlen) {
                    return showErr($tech_advantage, maxlen + "字以内");
                }
                var $tech_used_range = $("#tech_used_range");
                maxlen = $tech_used_range.attr('maxlength');
                var tech_used_range = $tech_used_range.val();
                if (tech_used_range.length > maxlen) {
                    return showErr($tech_used_range, maxlen + "字以内");
                }
                var $tech_device_case = $("#tech_device_case");
                maxlen = $tech_device_case.attr('maxlength');
                var tech_device_case = $tech_device_case.val();
                if (tech_device_case.length > maxlen) {
                    return showErr($tech_device_case, maxlen + "字以内");
                }
                var $tech_vista = $("#tech_vista");
                maxlen = $tech_vista.attr('maxlength');
                var tech_vista = $tech_vista.val();
                if (tech_vista.length > maxlen) {
                    return showErr($tech_vista, maxlen + "字以内");
                }
                var id = $('#tech_id').val();
                var html = '';
                var $p = $('.j_techItem');
                html += '<div class="form-group">' +
                        '<a class="edit j_editItem">编辑</a>' +
                        '<label>名称</label>' +
                        '<div class="form-control_text">' + tech_device_name + '</div>' +
                        '</div>' +
                        '<div class="form-group">' +
                        '<a class="del j_delItem">删除</a>' +
                        '<label>技术/设备分类</label>' +
                        '<div class="form-control_text">' + tech_device_type_text + '</div>' +
                        '</div>' +
                        '<input type="hidden" class="j_tech_device_type" value="' + tech_device_type + '">' +
                        '<input type="hidden" class="j_tech_device_name" value="' + tech_device_name + '">' +
                        '<input type="hidden" class="j_tech_device_brand" value="' + tech_device_brand + '">' +
                        '<input type="hidden" class="j_tech_device_bool_patent" value="' + tech_device_bool_patent + '">' +
                        '<input type="hidden" class="j_tech_device_fix_years" value="' + tech_device_fix_years + '">' +
                        '<input type="hidden" class="j_tech_content" value="' + tech_content + '">' +
                        '<input type="hidden" class="j_tech_main_point" value="' + tech_main_point + '">' +
                        '<input type="hidden" class="j_tech_advantage" value="' + tech_advantage + '">' +
                        '<input type="hidden" class="j_tech_used_range" value="' + tech_used_range + '">' +
                        '<input type="hidden" class="j_tech_device_case" value="' + tech_device_case + '">' +
                        '<input type="hidden" class="j_tech_vista" value="' + tech_vista + '">';
                if (!id) {
                    $p.append('<li>' + html + '</li>');
                } else {
                    $p.find('li').eq(id).html(html);
                }
                $('.j_itemTable,.j_popBg').css('display', 'none');

            });
            //取消
            $('.j_cancelItem').on('click', function () {
                $('.j_itemTable,.j_popBg').css('display', 'none');
            });
            //提交渔船节能技改项目技术/设备报名信息
            $('.j_submitSupplier').on('click', function () {
                var $btn = $(this);
                var maxlen = 0;
                var $company_name = $("#company_name");
                maxlen = $company_name.attr('maxlength');
                var company_name = $company_name.val();
                if (!company_name || company_name.length > maxlen) {
                    return showErr($company_name, "请输入企业名称，" + maxlen + "字以内");
                }
                var $user_name = $("#user_name");
                maxlen = $user_name.attr('maxlength');
                var user_name = $user_name.val();
                if (!user_name || user_name.length > maxlen) {
                    return showErr($user_name, "请输入企业联系人，" + maxlen + "字以内");
                }
                var $user_phone = $("#user_phone");
                maxlen = $user_phone.attr('maxlength');
                var user_phone = $user_phone.val();
                if (!user_phone || user_phone.length > maxlen || !isPhone(user_phone)) {
                    return showErr($user_phone, "请输入企业联系电话，必须是手机号码");
                }
                var $company_desc = $("#company_desc");
                maxlen = $company_desc.attr('maxlength');
                var company_desc = $company_desc.val();
                if (!company_desc || company_desc.length > maxlen) {
                    return showErr($company_desc, "请输入企业概况，" + maxlen + "字以内");
                }
                var tech_device_list = [];
                var i = 0, $tech_device_list = $('.j_techItem'), techLen = $tech_device_list.find('li').length;
                if (techLen === 0) {
                    return showErr($company_desc, "至少需要一条供应项记录");
                }
                for (; i < techLen; i++) {
                    var $li = $tech_device_list.find('li').eq(i);
                    tech_device_list.push({
                        'tech_device_type': $li.find('.j_tech_device_type').val(),
                        'tech_device_name': $li.find('.j_tech_device_name').val(),
                        'tech_device_brand': $li.find('.j_tech_device_brand').val(),
                        'tech_device_bool_patent': $li.find('.j_tech_device_bool_patent').val(),
                        'tech_device_fix_years': $li.find('.j_tech_device_fix_years').val(),
                        'tech_content': $li.find('.j_tech_content').val(),
                        'tech_main_point': $li.find('.j_tech_main_point').val(),
                        'tech_advantage': $li.find('.j_tech_advantage').val(),
                        'tech_used_range': $li.find('.j_tech_used_range').val(),
                        'tech_device_case': $li.find('.j_tech_device_case').val(),
                        'tech_vista': $li.find('.j_tech_vista').val()
                    });
                }
                $.ajax({
                    url: "/form",
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    data: {
                        form_type: 'boater',
                        user_name: user_name,
                        user_phone: user_phone,
                        company_name: company_name,
                        company_desc: company_desc,
                        tech_device_list: tech_device_list
                    },
                    type: "POST",
                    dataType: "json",
                    success: function (data) {
                        if (data["result"] == 0) {
                            $.Alert({
                                obj: $btn, txt: '提交成功！', callback: function () {
                                    $("#j_alert").remove();
                                    location.hash = hashs[0];
                                }
                            });
                        } else {
                            $.Alert({
                                obj: $btn, txt: data["msg"], type: 'danger'
                            });
                        }
                    }
                });
            });

            var hashs = ['', 'boater'];
            hashChange();

            //返回
            $('.j_backUrl').on('click', function () {
                location.hash = hashs[0];
            });

            function hashChange(hash) {
                if (!hash) {
                    hash = location.hash;
                    if (!hash) {
                        hash = hashs[0];//没有任何hash值默认第一个
                    }
                }
                hash = hash.replace("#", "");
                var index = 0;
                for (var i = 0, l = hashs.length; i < l; i++) {
                    if (hashs[i] === hash) {
                        index = i;
                        break;
                    }
                }
                //开始执行对应hash内容变化
                $(".act1_body").css("display", "none").eq(index).css("display", "block");
            }

            window.onhashchange = function () {
                hashChange(location.hash);
            };
        });
    })(jQuery);
</script>


@endsection
